|
|
|
|
|
|
|
Visual Basic provides all the tools you need to generate any type of graphic image. It supplies routines for drawing text, lines, rectangles, circles, ellipses, and a host of other graphic shapes. The Point and PSet methods allow you to specify the exact value for every pixel in an image, giving you absolute control over the result. This chapter explains these fundamental tools that Visual Basic gives you for producing graphics. |
|
|
|
|
|
|
|
|
The chapter begins by describing graphic coordinate systems in Visual Basic. There are many coordinate systems you can use to make graphic programming easier. Depending on your application, you may find it most convenient to measure distances in pixels, twips, millimeters, inches, or even a custom scale you design. |
|
|
|
|
|
|
|
|
The sections that follow describe the methods that are most useful for drawing graphics in Visual Basic. Using these methods, you can display points, lines, circles, and other simple graphic objects that you can use to build more complicated pictures. |
|
|
|
|
|
|
|
|
Next, the chapter discusses graphic events and properties that help you manage graphic operations. The chapter finishes with an introduction to the simple color system used by many Visual Basic applications. |
|
|
|
|
|
|
|
|
Visual Basic Coordinate Systems |
|
|
|
|
|
|
|
|
The three most important types of object for drawing in Visual Basic are the form, picture box, and printer. These objects support a wide variety of drawing commands that you can use to produce graphics. Forms, picture boxes, and printer objects provide almost exactly the same graphic operations, so most of the things you can do with one you can do with the others. For example, all three objects use scale properties to define their drawing coordinates, and all three use the Line statement to draw lines. |
|
|
|
|
|
|
|
|
To make referring to these objects easier, this book sometimes calls them drawing objects. A drawing object is any object such as a form, picture box, or printer that accepts the standard Visual Basic drawing commands. In later chapters, you will see that these objects also support the same nonstandard drawing operations provided by API functions. |
|
|
|
|
|